<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<div class="portlet box green">
	<div class="portlet-title">
		<div class="caption">
			<i class="fa fa-gift"></i>手动发货
		</div>
	</div>
	<div class="portlet-body form">
		<form id="deliverGoodsForm" class="form-horizontal form-bordered"
			action="/deliverGoods/save" method="post">
			<div class="form-group">
				<label class="col-md-3 control-label">订单号:</label>
				<div class="col-md-4">
					<span>${ordertCode}</span>
				</div>
			</div>
			<div class="form-group">
				<label class="col-md-3 control-label">发货仓库:</label>
				<div class="col-md-4">
					<select id="detailListWarehouseId" style="width: 200px;"
						class="form-control" onclick="getWarehouse()">
						<c:forEach items="${warehouses}" var="warehouse" varStatus="vs">
							<option value="${warehouse.id}">${warehouse.name}</option>
						</c:forEach>
					</select>
				</div>
			</div>
			<div class="form-group">
				<label class="col-md-3 control-label">物流平台:</label>
				<div class="col-md-4">
					<select id="logisticsId" style="width: 200px;" name="logisticsId"
						class="form-control">
						<c:forEach items="${loglist}" var="log" varStatus="vs">
							<option value="${log.id}">${log.name}</option>
						</c:forEach>
					</select>
				</div>
			</div>
			<div class="form-group">
				<label class="col-md-3 control-label">物流编号:</label>
				<div class="col-md-4">
					<input type="text" name="logisticsCode" class="form-control"
						value="${deliverGoods.logisticsCode}"/>
				</div>
			</div>
			<div class="form-actions">
				<div class="col-md-9 col-md-offset-3">
					<button type="button" class="btn btn-primary" onclick="save(this)">
						<spring:message code="btn.save"></spring:message>
					</button>
					<button type="reset" class="btn btn-default" onclick="cancel()">
						<spring:message code="btn.return"></spring:message>
					</button>
				</div>
			</div>
			<input type="hidden" name="id" value="${deliverGoods.id}"> <input
				type="hidden" name="ordertId" value="${ordertId}">
		</form>
	</div>
</div>
<script type="text/javascript"
	src="<c:url value="/static/custom/datepicker-util.js"></c:url>"></script>
<script type="text/javascript">
	function getWarehouse() {
		var warehouseId = $("#detailListWarehouseId").find("option:selected")
				.val();

		$.ajax({
			type : 'post',
			url : webRoot + '/warehouse/getLogisticses',
			data : {
				'warehouseId' : warehouseId

			},
			success : function(data) {

			}
		});
	}
	$(function() {
		$('#deliverGoodsForm').validate();
	});
</script>